/*
 * MainMenuScreen.cpp
 *
 *  Created on: 2011-03-29
 *      Author: lpieczkowski
 */

#include <FGraphics.h>
#include <FGraphicsOpengl.h>

#include "Screens/MainMenuScreen.h"
#include "Vertex/MainMenuScreen.v"
#include "Callbacks/MainMenuCallback.h"
#include "Menu/Menu.h"

using namespace Osp::Graphics::Opengl;
using namespace Osp::Base;

MainMenuScreen::MainMenuScreen()
{

}

MainMenuScreen::~MainMenuScreen()
{

}

void MainMenuScreen::Initialize(void)
{
	menu = new Menu(&(HitTheLines::getInstance()->font), this);
	menu->Init();
	menu->AddItem("Play arcade", playArcadeHandler);
	menu->AddItem("Play challenge", playChallengeHandler);
	menu->AddItem("Highscores", highscoresHandler);
	menu->AddItem("About", aboutHandler);
	menu->Build();
}

void MainMenuScreen::UpdateLogic(void)
{

}

void MainMenuScreen::Render(void)
{
	menu->Render();
}

void MainMenuScreen::PointerPressed(float x, float y)
{
	if (menu->IsPointInside(x, y)) {
		menu->HandleInput(x, y);
	}
}

void MainMenuScreen::NavigateBack()
{
	HitTheLines::getInstance()->NavigateBack();
}

void MainMenuScreen::CleanUp()
{
	menu->CleanUp();
	delete menu;
}

std::string MainMenuScreen::GetScreenName()
{
	std::string name = "MainMenuScreen";
	return name;
}
